import pytest
import os
import tempfile
from pathlib import Path
from video_agent.encoder import VideoEncoder
from video_agent.model import ModelCaller
from video_agent.processor import VideoProcessor

@pytest.fixture
def temp_dir():
    """创建临时目录"""
    with tempfile.TemporaryDirectory() as tmpdirname:
        yield Path(tmpdirname)

@pytest.fixture
def sample_video(temp_dir):
    """创建示例视频文件"""
    video_path = temp_dir / "test.mp4"
    with open(video_path, "wb") as f:
        f.write(b"fake video content")
    return video_path

@pytest.fixture
def video_encoder():
    """创建视频编码器实例"""
    return VideoEncoder()

@pytest.fixture
def model_caller():
    """创建模型调用器实例"""
    return ModelCaller()

@pytest.fixture
def video_processor(video_encoder, model_caller):
    """创建视频处理器实例"""
    return VideoProcessor(encoder=video_encoder, model_caller=model_caller) 